{% extends "layout.html" %}

{% block main %}
<!-- <h1>用户列表</h1> -->
<ol class="breadcrumb">
  <li><a href="/admin">管理首页</a></li>
  <li><span>分类列表</span></li>
</ol>
<h3>分类列表</h3>
{% include "page.html" %}
<table class = "table table-hover table-striped">
	<!-- tr>th*4 + tab键 -->
	<tr>
		<td>ID</td>
		<th>分类名称</th>
		<th>操作</th>
	</tr>
	<!-- 通过模板的循环语法进行数据输出 -->
	{%for category in categories%}
	<tr>
		<td>{{category._id.toString()}}</td>
		<td>{{category.name}}</td>
		<td>
			<a href="/admin/category/edit?id={{category._id.toString()}}">修改</a>
			<a href="/admin/category/delete?id={{category._id.toString()}}">删除</a>
		</td>
	</tr>
	{%endfor%}
</table>
{% include "page.html" %}
{% endblock %}